package com.example.helloImageDetection;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Path.Direction;
import android.util.AttributeSet;
import android.view.View;

public class OverlayLightSquare extends View{
	
	private final static int L = 250;

	public OverlayLightSquare(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	public OverlayLightSquare(Context context) {
		super(context);
	}
	
	@Override
	protected void onDraw(Canvas canvas) {
		super.onDraw(canvas);
		
		Paint p = new Paint();
		p.setColor(0xaa000000);
		
		int fw = getWidth();
		int fh = getHeight();
		
		Path r = new Path();
		r.addRect(0, 0, fw, (fh-L)/2, Direction.CW);
		r.addRect(0, (fh-L)/2, (fw-L)/2, (fh+L)/2, Direction.CW);
		r.addRect((fw+L)/2, (fh-L)/2, fw, (fh+L)/2, Direction.CW);
		r.addRect(0, (fh+L)/2, fw, fh, Direction.CW);
		
		canvas.drawPath(r, p);
	}
	
	

}
